<template>
	<ConfigProvider :component-size="assemblySize" :locale="getCurrentLanguage() === 'en' ? enUS : zhCN">
		<router-view />
	</ConfigProvider>
</template>

<script lang="ts" setup>
import { GlobalStore } from "@/store/modules/global";
import { ConfigProvider } from "ant-design-vue";
import enUS from "ant-design-vue/es/locale/en_US";
import zhCN from "ant-design-vue/es/locale/zh_CN";
import { computed } from "vue";
import useLanguage from "./hooks/useLanguage";

const { getCurrentLanguage } = useLanguage();
const globalStore = GlobalStore();
const assemblySize = computed(() => globalStore.assemblySize);


// 设置antdv按钮尺寸
globalStore.setAssemblySizeSize("middle");

ConfigProvider.config({
	theme: {
		primaryColor: "#1890ff",
		errorColor: "#ff4d4f",
		warningColor: "#faad14",
		successColor: "#52c41a",
		infoColor: "#f99d34"
	}
});
</script>

<style lang="less" scoped>

.ant-pro-sider {
	z-index: 20;
}

/* 设置滚动条的样式 */
&::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
/* 滚动槽 */
&::-webkit-scrollbar-track {
  -webkit-box-shadow: inset006pxrgba(0, 0, 0, 0.3);

  border-radius: 10px;
}
/* 滚动条滑块 */
&::-webkit-scrollbar-thumb {
  border-radius: 10px;

  background: rgba(0, 0, 0, 0.1);

  -webkit-box-shadow: inset006pxrgba(0, 0, 0, 0.5);
}
&::-webkit-scrollbar-thumb:window-inactive {
  background: @primary-color;
}
</style>
